from alipay import AliPay
from django.conf import settings

app_private_key_string = open(settings.APP_PRIVATE_PATH).read()
alipay_public_key_string = open(settings.ALIPAY_PUBLIC_PATH).read()

alipay = AliPay(
    appid="2016092400583432",
    app_notify_url="http://127.0.0.1:8000/alipay/",  # 默认回调url
    app_private_key_string=app_private_key_string,
    # 支付宝的公钥，验证支付宝回传消息使用，不是你自己的公钥,
    alipay_public_key_string=alipay_public_key_string,
    sign_type="RSA2",  # RSA 或者 RSA2
    debug=False  # 默认False
)

__all__ = ["alipay"]
